package com.wavecoler.professor.dao;

import com.google.appengine.api.datastore.Key;

import javax.jdo.PersistenceManager;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.wavecoler.professor.objects.AdviceCategory;
import com.wavecoler.professor.objects.AdviceType;
import com.wavecoler.dao.PMF;

@PersistenceCapable
public class AdviceTypeDAO {
	
	// Insertar, Modificar y Eliminar
	
	public void saveAdviceType(String adviceTypeNum, String Description, AdviceCategory adviceCategory) {
		PersistenceManager pm = PMF.get().getPersistenceManager();
		AdviceType adviceType = new AdviceType(adviceTypeNum, Description, adviceCategory);
		
		try {
            pm.makePersistent(adviceType);
        } finally {
            pm.close();
        }
	}
}
